package com.example.demo.cimfrontroute.kit;

import com.example.demo.cimfrontroute.config.AppConfiguration;
import com.example.demo.cimfrontroute.util.SpringBeanFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.swing.*;

/**
 * @author ：Anitaxiaofeng
 * @description：
 * @create 2019-01-23
 **/
public class ServerListListener implements Runnable {

    private static Logger logger = LoggerFactory.getLogger(ServerListListener.class);

    private ZKit zkUtil;

    private AppConfiguration appConfiguration;


    public ServerListListener() {
        zkUtil = SpringBeanFactory.getBean(ZKit.class);
        appConfiguration = SpringBeanFactory.getBean(AppConfiguration.class);
    }

    @Override
    public void run() {
        zkUtil.subscribeEvent(appConfiguration.getZkRoot());
    }
}
